import serial
import time
import sys

# print("reset esp32 on ", sys.argv[1])

ser=serial.Serial("COM6")

ser.setDTR(0)
ser.setRTS(1)

time.sleep(0.3)

ser.setDTR(0)
ser.setRTS(0)
time.sleep(0.3)

ser.reset_input_buffer()
ser.reset_output_buffer()
ser.close()